<%@page import="com.qdu.entity.Log"%>
<%@page import="com.qdu.entity.ActiComment"%>
<%@page import="java.util.List"%>
<%@page import="com.qdu.entity.Activity"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>公益活动</title>

        <link href="css/bootstrap.min.css" rel="stylesheet" />
        <link href="css/flexslider.css" rel="stylesheet" />
        <link href="css/style.css" rel="stylesheet" />
        <link href="css/style_1.css" rel="stylesheet" />
        <link href="css/buttons.css" rel="stylesheet">
        <link rel="stylesheet" href="css/font-awesome.min.css">

        <link href="css/bootstrap.min.js" rel="stylesheet" />
        <script src="js/jquery.min.js"></script>

        <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
        <link href='http://fonts.useso.com/css?family=Source+Sans+Pro:200,300,400,600,700,900' rel='stylesheet' type='text/css'>
    </head>

    <body>
        <div class="header">
            <div class="container">
                <a class="navbar-brand" href="index"><i class="fa fa-home"></i>Home</a>

                <div class="text-center">
                    <!--搜索页面-->
                    <form action="gnms" class="form-inline">
                        <input type="text" id="input_wd" name="keyword" class="form-control keyword_text" placeholder="输入活动名称">
                        <button type="submit" class="btn banner_btn keyword_text1">搜索</button>
                    </form>

                </div>

                <div class="menu"> <a class="toggleMenu" href="#"><img src="images/nav_icon.png" alt="" /> </a>
                    <ul class="nav" id="nav">
                        <li class=""><a href="salfm">日志</a></li>
                        <li><a href="allActivity">活动</a></li>
                        <li><a href="profile">个人页面</a></li>
                        <li><a href="wrmps">管理员登录</a></li>

                    </ul>
                    <script type="text/javascript" src="js/responsive-nav.js"></script> 
                </div>
            </div>
        </div>
        <%
            Activity Info = (Activity) request.getAttribute("activityInfo");
            List<ActiComment> comment = (List<ActiComment>) request.getAttribute("comment");
            
        %>
        <div class="about_content">
            <div class="container">
                <div class="row">
                    <div class="col-md-9"> 
                        <h1><%=Info.getAname()%>（状态：<%=Info.getAstatus()%>）</h1>
                        <!--这个地方应该是活动的封面-->
                        <img src="images/bg1.jpg" class="img-responsive" alt=""/>
                        <h2>活动要求</h2>
                        <p>志愿者等级要求：<%=Info.getArank()%></p>
                        <p>时间：<%=Info.getAstartTime()%>--<%=Info.getAendTime()%></p>
                        <p>人数：<%=Info.getAnumber()%></p>
                        <p>简介：</p>
                        <p><%=Info.getAnote()%></p>
                        <!--转到那个报名页面，来实现报名的相关操作，就是数据库的增加-->
                        <form method="get" action="signUp">
                            <button type="submit" class="submit">我要报名</button>
<!--                            <input type="text" name="Uid" class="hidden" value="U0001">-->
                            <input type="text" name="key" class="hidden" value="1">
                            <input type="text" name="Aid" class="hidden" value="<%=Info.getActivityId()%>" >
                        </form>
                        
                        <br>
                        <br>
                        <br>
                        <!--用foreach循环-->

                        <%
                            for (ActiComment comment1 : comment) {
                        %>
                        <div class="contact_details">
                            <i class="fa fa-user">:<%=comment1.getUserId()%></i>
                            <br>
                            <div class="contact_address"><h5>评论内容:<%=comment1.getAccontent()%></h5></div>
                            时间：<%=comment1.getActime()%>
                            <a href="agree?activityId=<%=Info.getActivityId() %>&acommentId=<%=comment1.getAcommentId()%>" style="float: right;">
                                <i class="fa fa-thumbs-up"><%=comment1.getAcagree()%></i>
                            </a>
                        </div>
                        <br>
                        <%
                            }
                        %>

                        <br>
                        <h3>发布评论:</h3>
                        <!--表单提交，提交给数据库存储-->
                        <form method="get" action="pinglun">
                            <input type="hidden" name="activityId" value="<%=Info.getActivityId()%>"/>
                            <!--合在一起后，获得用户名，placeholder改成value-->
                            <div class="text2">
                                <textarea name="content" class="form-control" placeholder="输入评论"></textarea>
                                
                            </div>
                            <%--<%= //这里应该是写这个的 Info.getActivityId()%>--%>
                            <button type="submit" class="submit">提交评论</button>
                        </form>
                    </div>


                    <div class="col-md-3 ">
                        <h2 class="title-section" style="text-align: center;">相关日志</h2>
                        <!--这个是日志的超链接-->
                        <c:forEach items="${requestScope.log}" var="log" begin="0" end="2">
                        <a href="solfm?logId=${log.getId()}"><img style="float: none;" src="images/A0001.jpg" alt="图片丢失" /></a>
                        <div class="copy">
                            <a href="#" target="_blank">${log.getName()}</a>
                        </div>
                        <p>${log.getContent()}
                        </p>
                        </c:forEach>
                        <div class="clearfix" style="text-align: center;">
                            <a href="bpls?id=<%=Info.getActivityId() %>">
                                <button class="submit">我要发布日志</button>
                            </a> 
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="footer">
            <div class="footer_bottom">
                <div class="follow-us"> <a class="fa fa-facebook social-icon" href="#"></a> <a class="fa fa-twitter social-icon" href="#"></a> <a class="fa fa-linkedin social-icon" href="#"></a> <a class="fa fa-google-plus social-icon" href="#"></a> </div>
                <div class="copy">
                    <p>制作人@软件外包BD03班平平无奇天才队 <a href="#" target="_blank" title="联系我们">联系我们</a> 
                </div>
            </div>
        </div>
    </body>
</html>
